<?php
    // 这个接口用于根据id和数据跟新 分类的记录

    include_once '../../fn.php';

    $id = $_GET['id'];
    $name = $_GET['name'];
    $slug = $_GET['slug'];

    // 构建sql串
    $sql = "update categories SET slug = '$slug', name='$name' WHERE id = $id;";

    $result = my_exec($sql);

    echo json_encode($result);
?>